//
//  AGZFBOptionSecoundCell.m
//  Gunterapple
//
//  Created by 热带雨林 on 2020/4/3.
//  Copyright © 2020 热带雨林. All rights reserved.
//

#import "AGZFBOptionSecoundCell.h"
#import "GGAddtion.h"
#import "GGBtnsView.h"
@interface AGZFBOptionSecoundCell ()<btnViewsDelegate>
@property (nonatomic, weak)UIImageView *icon;
@property (nonatomic, weak)UILabel *name;
@property (nonatomic, strong) GGBtnsView *btnsView;
@end
@implementation AGZFBOptionSecoundCell
- (instancetype)initWithFrame:(CGRect)frame{
    if(self = [super initWithFrame:frame]){
        [self setUI];
    }
    return self;
}
- (void)setUI{
    UIImageView *icon = [[UIImageView alloc]initWithFrame:CGRectZero];
    [self.contentView addSubview:icon];
    self.icon = icon;
    icon.image = [UIImage imageNamed:@"user02_icon"];
    
    UILabel *name = [[UILabel alloc]init];
    self.name = name;
    self.name.text = @"iOS研发工程师 https://txt07.cn";
    self.name.font = [UIFont fontWithName:@"Helvetica-Bold" size:15];
    [self.name sizeToFit];
    [self.contentView addSubview:name];
    self.btnsView = [[GGBtnsView alloc]initWithFrame:CGRectZero];
    self.btnsView.delegate = self;
    [self.contentView addSubview:self.btnsView];
  
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self.contentView).offset(8);
        make.size.mas_equalTo(CGSizeMake(48, 48));
    }];
    [self.name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.icon);
        make.left.equalTo(self.icon.mas_right).offset(10);
        make.right.lessThanOrEqualTo(self.contentView.mas_right).offset(-10);
    }];
    [self.btnsView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.icon.mas_right).offset(8);
        make.width.mas_greaterThanOrEqualTo(350);
        make.height.mas_equalTo(32);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(0);
    }];
}
- (void)btnViwesWithType:(NSInteger)type{
    if([self.delegate respondsToSelector:@selector(secoundcellWithType:)]){
        [self.delegate secoundcellWithType:type];
    }
//    switch (type) {
//        case 1:{
//
//        }
//            break;
//        case 2:{
//
//        }
//            break;
//        case 3:{
//
//        }
//            break;
//        default:
//            break;
//    }
}
@end
